import QtQuick 2.15
import QtQuick.Window 2.15

Window {
    width: 800
    height: 650
    visible: true
    title: qsTr("Hello World")

    Column {
        Text {
            text: "Hikcamera Demo"
            font.pixelSize: 50
        }
        Image {
            id: imageFrame
            width: 800
            height: 600
            property int counter: 0
            function refreshImage() {
                counter = !counter
                source = "image://myImageProvider?id=" + counter
            }
        }
    }

    Component.onCompleted: {
        mySDK.deviceInit()
    }

    Connections {
        target: grabThread
        function onRefreshImage() {
            imageFrame.refreshImage()
        }
    }
}
